//
//  BChargeCashTabBarController.m
//  GSBlockChain
//
//  Created by guoshikeji_a on 2019/1/7.
//  Copyright © 2019 guoshikeji. All rights reserved.
//

#import "BChargeCashTabBarController.h"
//充
#import "BChargeCashSubChargeController.h"
//提
#import "BChargeCashSubCashController.h"

@interface BChargeCashTabBarController ()

@property (nonatomic, strong) BChargeCashSubCashController *cashController;
@property (nonatomic, strong) BChargeCashSubChargeController *chargeController;

@end

@implementation BChargeCashTabBarController

//
- (BChargeCashSubCashController *)cashController {
    if (!_cashController) {
        _cashController = [BChargeCashSubCashController new];
    }
    return _cashController;
}
- (BChargeCashSubChargeController *)chargeController {
    if (!_chargeController) {
        _chargeController = [BChargeCashSubChargeController new];
    }
    return _chargeController;
}


- (void)viewDidLoad {
    [super viewDidLoad];
    //
    self.tabBar.hidden = true;
    //
    [self setChargeCashes];
}

- (void)setChargeCashes {
    NSArray *controllers = @[self.chargeController,self.cashController];
    if (self.containerController) {
        self.containerController = _containerController;
    }
    self.viewControllers = controllers;
}


- (void)setContainerController:(UIViewController *)containerController {
    _containerController = containerController;
    //
    if (_chargeController) {
        _chargeController.containerController = containerController;
    }
    if (_cashController) {
        _cashController.containerController = containerController;
    }
}


- (void)resetControllers {
    if (_chargeController) {
        _chargeController = nil;
    }
    if (_cashController) {
        _cashController = nil;
    }
    //
    [self setChargeCashes];
}

@end
